﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RaiderManagerBackend
{
    public class AttendanceEntry
    {
        private Raid _raid;
        private Player _player;
        private int _attendanceEntryId;
        private Enumerations.AttendanceCode _attendanceCode;
        private Enumerations.SignUpCode _signupCode;

        public AttendanceEntry(Player player, Raid raid)
        {
            Player = player;
            Raid = raid;
        }

        public Raid Raid
        {
            get { return _raid; }
            private set { _raid = value; }
        }

        public Player Player
        {
            get { return _player; }
            private set { _player = value; }
        }

        public int AttendanceEntryId
        {
            get { return _attendanceEntryId; }
            private set { _attendanceEntryId = value; }
        }

        public Enumerations.AttendanceCode AttendanceCode
        {
            get { return _attendanceCode; }
            set { _attendanceCode = value; }
        }

        public Enumerations.SignUpCode SignUpCode
        {
            get { return _signupCode; }
            set { _signupCode = value; }
        }

        public void SaveAttendanceEntry()
        {
            if (AttendanceEntryId == 0)
            {
                Player.AttendanceEntries.Add(this);
                Raid.AttendanceEntries.Add(this);
            }
        }
    }
}
